<?php

class Openingbank{

    //银行卡号数据字典，根据卡号返回银行名称
    public static function getBank($bank_card)
    {
        $bank_name = '';
        $banks = array(
            '436742' =>'中国建设银行VISA龙卡借记卡'   ,
            '436745' =>'中国建设银行VISA龙卡贷记卡' ,
            '622280' =>'中国建设银行支付宝龙卡借记卡'  ,
            '458123' =>'交通银行VISA普通卡' ,
            '521899' =>'交通银行MC信用卡普通卡'  ,
            '622260' =>'交通银行太平洋卡借记卡'  ,
            '402674' =>'上海银行VISA金卡',
            '622892' =>'上海银行借记卡',
            '622188' =>'中国邮政储蓄绿卡借记卡',
            '602969' =>'北京银行京卡借记卡',
            '622760' =>'中国银行中银都市卡',
            '409666' =>'中国银行BOC系列VISA标准卡普通卡/VISA高校认同卡',
            '438088' =>'中国银行国航知音信用卡',
            '622752' =>'中国银行上海市分行长城人民币贷记卡普通卡',
            '427020' =>'中国工商银行VISA学生国际信用卡 ',
            '427030' =>'中国工商银行VISA国际信用卡金卡',
            '530990' =>'中国工商银行MC国际信用卡普通卡',
            '622230' =>'中国工商银行新版人民币贷记卡普卡',
            '622235' =>'中国工商银行新版人民币贷记卡金卡',
            '622210' =>'中国工商银行新版信用卡(准贷)普卡',
            '622215' =>'中国工商银行新版信用卡(准贷)金卡',
            '622200' =>'中国工商银行牡丹灵通卡借记卡 ',
            '955880' =>'中国工商银行原牡丹灵通卡借记卡 ',
            '622568' =>'广东发展银行新理财通借记卡 ',
            '520152' =>'广东发展银行南航明珠卡MC金卡 ',
            '520382' =>'广东发展银行南航明珠卡MC普卡 ',
            '911121' =>'广东发展银行理财通借记卡 ',
            '548844' =>'广发真情卡',
            '512431' =>'宁波银行',
            '520194' =>'宁波银行',
            '622318' =>'宁波银行',
            '622778' =>'宁波银行',
            '622282' =>'宁波银行汇通卡人民币金卡/钻石联名卡',
            '407405' =>'民生银行',
            '517636' =>'民生银行',
            '512466' =>'中国民生银行MC金卡 ',
            '415599' =>'中国民生银行星座卡借记卡 ',
            '421870' =>'中国民生银行VISA信用卡金卡 ',
            '622622' =>'中国民生银行蝶卡银卡借记卡 ',
            '528948' =>'民生银行',
            '552288' =>'民生银行',
            '556610' =>'民生银行',
            '622600' =>'民生银行',
            '622601' =>'民生银行',
            '622602' =>'民生银行',
            '622603' =>'民生银行',
            '421869' =>'民生银行',
            '421871' =>'民生银行',
            '628258' =>'民生银行',
            '418152' =>'上海浦东发展银行奥运WOW卡美元单币',
            '456418' =>'上海浦东发展银行WOW卡/奥运WOW卡',
            '622521' =>'上海浦东发展银行东方卡借记卡 ',
            '404738' =>'上海浦东发展银行VISA普通卡 ',
            '404739' =>'上海浦东发展银行VISA金卡 ',
            '498451' =>'浦东发展银行',
            '622517' =>'浦东发展银行',
            '622518' =>'浦东发展银行',
            '515672' =>'浦东发展银行',
            '517650' =>'浦东发展银行',
            '525998' =>'浦东发展银行',
            '356850' =>'浦东发展银行',
            '356851' =>'浦东发展银行',
            '356852' =>'浦东发展银行',
            '435744' =>'深发展联名普卡',
            '622526' =>'深发展卡普通卡',
            '435745' =>'深发展联名金卡',
            '998801' =>'深圳发展银行',
            '998802' =>'深圳发展银行',
            '622525' =>'深发展卡金卡',
            '622538' =>'深圳发展银行发展卡借记卡 ',
            '406254' =>'光大银行',
            '622655' =>'光大银行',
            '622650' =>'光大银行',
            '622658' =>'光大银行',
            '356839' =>'光大银行',
            '486497' =>'光大银行',
            '481699' =>'光大银行',
            '543159' =>'光大银行',
            '425862' =>'光大银行',
            '406252' =>'光大银行',
            '356837' =>'光大银行',
            '356838' =>'光大银行',
            '356840' =>'光大银行',
            '622161' =>'光大银行',
            '628201' =>'光大银行',
            '628202' =>'光大银行',
            '622155' =>'深圳平安银行',
            '622156' =>'深圳平安银行',
            '528020' =>'深圳平安银行万事达卡普卡',
            '526855' =>'深圳平安银行万事达卡金卡',
            '539867' =>'华夏银行',
            '528709' =>'华夏银行',
            '523959' =>'华夏银行MC钛金卡 ',
            '622637' =>'华夏银行人民币卡金卡 ',
            '622636' =>'华夏银行人民币卡普卡 ',
            '528708' =>'华夏银行MC金卡 ',
            '539868' =>'华夏银行MC普卡 ',
            '518710' =>'招商银行哆啦A梦粉丝信用卡',
            '518718' =>'招商银行哆啦A梦粉丝信用卡珍藏版卡面/MC贝塔斯曼金卡/MC车主卡',
            '622588' =>'招商银行QQ一卡通借记卡 ',
            '622575' =>'招商银行HELLO KITTY单币卡',
            '545947' =>'招商银行',
            '521302' =>'招商银行',
            '439229' =>'招商银行',
            '552534' =>'招商银行',
            '622577' =>'招商银行',
            '622579' =>'招商银行',
            '439227' =>'招商银行',
            '479229' =>'招商银行',
            '356890' =>'招商银行',
            '356889' =>'招商银行JCB信用卡普通卡',
            '356885' =>'招商银行',
            '439188' =>'招商银行VISA白金卡 ',
            '545948' =>'招商银行',
            '545623' =>'招商银行',
            '552580' =>'招商银行',
            '552581' =>'招商银行',
            '552582' =>'招商银行',
            '552583' =>'招商银行',
            '552584' =>'招商银行',
            '552585' =>'招商银行',
            '552586' =>'招商银行',
            '552588' =>'招商银行',
            '552589' =>'招商银行',
            '645621' =>'招商银行',
            '545619' =>'招商银行',
            '356886' =>'招商银行',
            '622578' =>'招商银行',
            '622576' =>'招商银行',
            '622581' =>'招商银行',
            '439228' =>'招商银行',
            '439225' =>'招商银行VISA信用卡普通卡',
            '439226' =>'招商银行VISA信用卡金卡',
            '628262' =>'招商银行',
            '628362' =>'招商银行',
            '628362' =>'招商银行',
            '628262' =>'招商银行',
            '376968' =>'中信银行',
            '376966' =>'中信银行',
            '622918' =>'中信银行',
            '622916' =>'中信银行',
            '518212' =>'中信银行国航知音信用卡/万事达卡普通卡',
            '622690' =>'中信银行理财宝卡借记卡 ',
            '520108' =>'中信银行万事达卡金卡',
            '376969' =>'中信银行',
            '622919' =>'中信银行',
            '556617' =>'中信银行',
            '622680' =>'中信银行蓝卡/I卡信用卡',
            '403391' =>'中信银行',
            '558916' =>'中信银行',
            '514906' =>'中信银行',
            '400360' =>'中信银行',
            '433669' =>'中信银行',
            '433667' =>'中信银行',
            '433666' =>'中信银行',
            '404173' =>'中信银行',
            '404172' =>'中信银行',
            '404159' =>'中信银行',
            '404158' =>'中信银行',
            '403393' =>'中信银行',
            '403392' =>'中信银行',
            '622689' =>'中信银行',
            '622688' =>'中信银行',
            '433668' =>'中信银行',
            '404157' =>'中信银行',
            '404171' =>'中信银行',
            '404174' =>'中信银行',
            '628209' =>'中信银行',
            '628208' =>'中信银行',
            '628206' =>'中信银行',
            '451289' =>'兴业银行',
            '622902' =>'兴业银行',
            '622901' =>'兴业银行',
            '527414' =>'兴业银行',
            '524070' =>'兴业银行',
            '486493' =>'兴业银行',
            '486494' =>'兴业银行',
            '451290' =>'兴业银行',
            '523036' =>'兴业银行',
            '486861' =>'兴业银行',
            '622922' =>'兴业银行',
            '552599' =>'农业银行',
            '404119' =>'农业银行',
            '404121' =>'农业银行',
            '519412' =>'农业银行',
            '403361' =>'农业银行',
            '558730' =>'农业银行',
            '520083' =>'农业银行',
            '520082' =>'农业银行',
            '519413' =>'农业银行',
            '49102'  =>'农业银行',
            '404120' =>'农业银行',
            '404118' =>'农业银行',
            '53591'  => '农业银行',
            '404117' =>'农业银行',
            '622836' =>'中国农业银行人民币贷记卡 香港旅游卡贷记卡金卡',
            '622837' =>'中国农业银行人民币贷记卡 香港旅游卡贷记卡普卡',
            '622848' =>'中国农业银行世纪通宝借记卡',
        );
        $str_six = substr($bank_card,0,6);
        foreach ($banks as $key => $value) {
            if($key==$str_six)
            {
                return $value;
            }
        }

        $str_five = substr($bank_card,0,5);
        foreach ($banks as $key => $value) {
            if($key==$str_five)
            {
                return $value;
            }
        }

        return $bank_name;
    }
}